import { InterFlowerRewardBaseWindow } from "./InterFlowerRewardBaseWindow";
import { ObjCreate } from "../../common/ObjCreate";
import { RewardRenderer } from "./RewardRenderer";
import { Cache } from "../../../cache/Cache";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { GTileList } from "../../../../../com/mui/controls/GTileList";
//class InterFlowerRewardWindow
    
    export  class InterFlowerRewardWindow extends InterFlowerRewardBaseWindow
    {
        constructor()
        {
            super();
            _type = 1;
            this.initList();
            return;
        }

        /* internal  */initList(): void
        {
            this._tilePanel = ObjCreate.createTileList(10, 50, 250, 330, this);
            this._tilePanel.columnWidth = 250;
            this._tilePanel.rowHeight = 80;
            this._tilePanel.setStyle("cellRenderer", RewardRenderer);
            return;
        }

        public updateRewardList(arg1: Map<any, any> /* flash.utils.Dictionary */): void
        {
            var loc2=undefined;
            var loc4=0;
            var loc1=Cache.instance.ranking.rewardKeys;
            var loc3=new DataProvider();
            while (loc4 < loc1.length) 
            {
                loc2 = loc1[loc4];
                loc3.addItem({"key": loc2, "reward": arg1[loc2]});
                ++loc4;
            }
            this._tilePanel.dataProvider = loc3;
            return;
        }

        /* internal */ /* var */_tilePanel: GTileList;
    }
